﻿@{
    Layout = "~/Views/_LayoutPage1.cshtml";
}


<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>

    <link href="~/Scripts/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    <div class="page" id="root">
    <div data-reactroot="">
        <input id="brid" type="hidden" value="@ViewBag.yyxx[0].BRID" />
        <input id="qhmm" type="hidden" value="@ViewBag.yyxx[0].PZHM" />
        <input id="yyrq" type="hidden" value="@ViewBag.yyxx[0].YYRQ" />
        <input id="hyid" type="hidden" value="@ViewBag.yyxx[0].HYID" />
        <input id="yyxh" type="hidden" value="@ViewBag.yyxx[0].YYXH" />
        <input id="out_trade_no" type="hidden" value="@ViewBag.out_trade_no" />
        <input id="ysxm" type="hidden" value="@ViewBag.yyxx[0].YGXM" />
        <input id="ksmc" type="hidden" value="@ViewBag.yyxx[0].KSMC" />
        <input id="brxm" type="hidden" value="@ViewBag.yyxx[0].BRXM" />
        <input id="jzsj" type="hidden" value="@ViewBag.yyxx[0].JZSJ" />
    
      

        <div class="register-details-2">
          <div class="panel g-space">
                <div class="list-ord">
                    <div class="list-item">
                        @if (ViewBag.yyxx[0].YYBZ == "已作废" || ViewBag.yyxx[0].YYBZ == "已取消")
                        {
                            <span class="list-icon-sm icon-cross"></span>
                        }
                        else
                        {
                            <span class="list-icon-sm icon-data-ready"></span>
                        }
                       
                        <div class="list-content">
                            <div class="list-title">@ViewBag.yyxx[0].YYBZ</div>
                            <div class="list-brief">@ViewBag.yyxx[0].YY</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel g-space">
                <div class="panel-title">预约信息</div>
                <ul class="list-ord ">
                    <li class="list-item list-item-middel">
                        <a href="#"
                           class="txt-arrowlink list-link-wrapper" >
                            <div class="list-brief-title">医院</div>
                            <div class="list-content">浙中医大二院</div>
                        </a>
                    </li>
                    <li class="list-item list-item-middel">
                        <a href="#" class="txt-arrowlink list-link-wrapper" >
                            <div class="list-brief-title">科室</div><div class="list-content">@ViewBag.yyxx[0].KSMC</div>
                        </a>
                    </li>
                    <li class="list-item list-item-middel">
                        <a href="#" class="txt-arrowlink list-link-wrapper" >
                            <div class="list-brief-title">医生</div><div class="list-content">@ViewBag.yyxx[0].YGXM</div>
                        </a>
                    </li>
                </ul><ul class="list-ord">
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">门诊类型</div><div class="list-content txt-nowrap">@ViewBag.yyxx[0].GHLB</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">序号</div>
                        <div class="list-content txt-nowrap">@ViewBag.yyxx[0].JZXH 号</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">就诊时间</div><div class="list-content txt-nowrap txt-prompt">@ViewBag.yyxx[0].JZSJ</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">取号密码</div>
                        <div class="list-content txt-nowrap txt-prompt">@ViewBag.yyxx[0].PZHM</div>
                    </li>
                </ul>
            </div>
            <div class="panel g-space">
                <div class="panel-title">就诊人信息</div><ul class="list-ord">
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">就诊人</div><div class="list-content txt-nowrap">@ViewBag.yyxx[0].BRXM</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">证件号</div><div class="list-content txt-nowrap txt-prompt">@ViewBag.yyxx[0].SFZH</div>
                    </li>
                </ul>
            </div>
            <div class="panel g-space">
                <div class="panel-title"><!-- react-text: 59 -->订单信息<!-- /react-text --></div><ul class="list-ord ">
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">订单编号</div><div class="list-content txt-nowrap">@ViewBag.out_trade_no</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">下单时间</div><div class="list-content txt-nowrap">@ViewBag.time</div>
                    </li>
                    <li class="list-item list-item-noborder">
                        <div class="list-brief-title">支付方式</div><div class="list-content txt-nowrap">到院支付</div>
                    </li>
                </ul><ul class="list-ord">
                    <li class="list-item ">
                        <div class="list-content">
                            <span class="txt-info">应付</span><span>
                                <span class="txt-size-sm">￥</span>@ViewBag.yyxx[0].GHF
                            </span>
                        </div><div class="list-extra"><span class="txt-info">实付</span><span class="txt-highlight">￥ @ViewBag.yyxx[0].GHF</span></div>
                    </li>
                </ul>
            </div>
            <div class="panel g-space">
                <div class="panel-title">就医提醒</div>
                <div class="panel-msg">
                    <p>1. 请于就诊时间前到达医院，找到自助机，凭本次预约对应就诊卡到医院自助机上自助取号。</p>
                    <p>2. 首次预约请携带本人身份证在自助机上办理就诊卡，儿童就诊人凭监护人身份证办理就诊卡。</p>
                </div>
            </div>
            @if (ViewBag.yyxx[0].YYBZ == "待取号")
            {
                <div class="fixed-foot-wrapper">
                    <div class="btn-wrapper g-footer register-btn-container" style="min-height: 50px;">
                        <div style="display: flex;">
                            <a onclick="cancel('0')" href="#">
                                <button class="btn btn-sm btn-secondary">取消预约</button>
                            </a>
                        </div>
                        <div style="display: flex;">
                            <a onclick="wechatpay()" href="#">
                                <button class="btn btn-sm btn-secondary">在线支付</button>
                            </a>
                        </div>
                    </div>
                </div>
            }
            
            @if (ViewBag.yyxx[0].YYBZ == "已取号")
            {
                <div class="fixed-foot-wrapper">
                    <div class="btn-wrapper g-footer register-btn-container" style="min-height: 50px;">
                       
                        <div style="display: flex;">
                            <a onclick="refund()" href="#">
                                <button class="btn btn-sm btn-secondary">退号</button>
                            </a>
                        </div>
                    </div>
                </div>
            }
            
            <div id="iscancel" class="modal-container" style="display:none">
                <div class="modal-main">
                    <div class="my-reservation">
                        <div class="reservation-modal-header">
                            <div onclick="cancel('1')" class="reservation-modal-header-cancel">取消</div>
                            <div onclick="qrcancel()" class="reservation-modal-header-confirm">确认</div>
                            <div>取消原因</div>
                        </div>
                    </div>
                    <div class="list-ord list-radio" style="font-size: 14px;">
                        <label class="list-item list-nowrap">
                            <div class="list-content">时间冲突不能按时就诊，提前取消</div>
                            <div class="list-extra ">
                                <span class="radio-wrapper">
                                    <input type="radio" name="appoint" id="label4" value="4">
                                </span>
                            </div>
                        </label><label class="list-item list-nowrap">
                            <div class="list-content">因为客观原因，当日不能及时到达医院</div>
                            <div class="list-extra ">
                                <span class="radio-wrapper">
                                    <input type="radio" name="appoint" id="label3" value="3">
                                </span>
                            </div>
                        </label><label class="list-item list-nowrap">
                            <div class="list-content">医院排队过长，不能按时取号</div>
                            <div class="list-extra "><span class="radio-wrapper"><input type="radio" name="appoint" id="label2" value="2"></span></div>
                        </label><label class="list-item list-nowrap">
                            <div class="list-content">我不想去了</div>
                            <div class="list-extra ">
                                <span class="radio-wrapper">
                                    <input type="radio" name="appoint" id="label1" value="1">
                                </span>
                            </div>
                        </label>
                        <label class="list-item list-nowrap">
                            <div class="list-content">其他原因</div>
                            <div class="list-extra ">
                                <span class="radio-wrapper">
                                    <input type="radio" name="appoint" id="label0" value="0">
                                </span>
                            </div>
                        </label>
                    </div>
                </div>
            </div>
            
        </div>
    </div>
    </div>

   
    <script src="~/Scripts/layui/layui.js"></script>
    <script>
        layui.use('layer', function () {
            var layer = layui.layer;

        });
        function cancel(type) {
            if (type == "0") {
                $("#iscancel").show();
            } else {
                $("#iscancel").hide();
            }
           
        }

        function qrcancel() {
            var yyxx = {
                BRID: $("#brid").val(),
                PZHM: $("#qhmm").val(),
                YYRQ: $("#yyrq").val(),
                DDHM: $("#out_trade_no").val(),
                YGXM: $("#ysxm").val(),
                KSMC: $("#ksmc").val(),
                BRXM: $("#brxm").val(),
                HYID: $("#hyid").val(),
                JZSJ: $("#jzsj").val(),
            }
            $.post("/Yygh/CancelYy", yyxx, function (result) {
                if (result == "0") {
                    window.location.href = "/Yygh/MyYygh";

                } else {
                    alert(result);
                }
            })
        }

        function wechatpay() {

             //alert("因用户经常在微信上取号,然后去窗口退号,所以关闭此功能");
            layer.confirm('确认要自费取号吗？(自费取号只能自费就诊,如需使用医保,请到医院窗口或者自助机上取号)', {
                btn: ['确认', '取消']
            },
                function (index, layero) {
                    window.location.href = "http://xhyy.zhujf.xin/PayFee/H5Pay?out_trade_no=" + $("#out_trade_no").val();
                }, function (index) {
                
                });
        }

        function refund() {

            //alert("因用户经常在微信上取号,然后去窗口退号,所以关闭此功能");
            layer.confirm('确认要退号吗？', {
                btn: ['确认', '取消']
            },
                function (index, layero) {
                    $.post("/Yygh/RefundFee", { "out_trade_no": $("#out_trade_no").val() }, function (result) {
                        if (result == "0") {
                            layer.alert("退费成功");
                            window.location.href = "/Yygh/MyYygh";

                        } else {
                          
                            layer.alert(result);
                          
                        }
                    })
                }, function (index) {

                });
        }
    </script>
</body>
</html>
